﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WpfUMLTry1.Model.Fight
{
    public class BasicSkill
    {
        private Int32 _cost;
        private Int32 _basicAttackDelayBonus;
        private Double _basicAttackDelayMultiplier;
        private String _name;
        private AttackStruct _flatSkillDamage;
        private AttackStruct _percentageDamage;
        private String _skillUsedText;
       

        public Int32 cost { get { return _cost; } set { _cost = value; } }
        public Int32 basicAttackDelayBonus { get { return _basicAttackDelayBonus; } set { _basicAttackDelayBonus = value; } }
        public Double basicAttackDelayMultiplier { get { return _basicAttackDelayMultiplier; } set { _basicAttackDelayMultiplier = value; } }
        public String name { get { return _name; } set { _name = value; } }
        public AttackStruct flatSkillDamage { get { return _flatSkillDamage; } set { _flatSkillDamage = value; } }
        public AttackStruct percentageDamage { get { return _percentageDamage; } set { _percentageDamage = value; } }
        public String skillText { get { return _skillUsedText; } set { _skillUsedText = value; } }

        virtual public Boolean activate(AbstractCreature user, AbstractCreature target)
        {
            if (user.fuel < cost)
            {
                skillText = "You dont have enough resourve for this skill\n";
                return false;
            }
            user.fuel -= cost;
            target.receiveAttack(user, flatSkillDamage + user.fullAttack * percentageDamage);
            user.attackDelay += (Int32)(user.basicAttackDelay() * basicAttackDelayMultiplier) + basicAttackDelayBonus;
            skillText = "You used " + name + " on " + target.name + "\n";
            return true;
        }
    }
}
